package jp.co.kayo.android.sample.activity;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

public class MainActivity extends Activity {
    final String TAG = "MainActivity";
    
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        Log.d(TAG, "onCreate");
        setContentView(R.layout.main);
        
        Button button = (Button)findViewById(R.id.button1);
        //ボタンにクリック時の処理を実装
        button.setOnClickListener(new OnClickListener() {
            //ここにボタンのイベント処理を実装する
            public void onClick(View v) {
                //例としてSubActivityという別のActivityを表示
                //引数に param1 というデータを設定
                Intent it = new Intent(MainActivity.this, SubActivity.class);
                it.putExtra("param1", "ホムホムホムマジホムホム");
                startActivity(it);
            }
        });
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        Log.d(TAG, "onDestroy");
    }

    @Override
    protected void onPause() {
        super.onPause();
        Log.d(TAG, "onPause");
    }

    @Override
    protected void onResume() {
        super.onResume();
        Log.d(TAG, "onResume");
    }

    @Override
    protected void onStart() {
        super.onStart();
        Log.d(TAG, "onStart");
    }

    @Override
    protected void onStop() {
        super.onStop();
        Log.d(TAG, "onStop");
    }
    
    
}